#pragma once
#include "afxwin.h"


// CItemManage dialog

class CItemManage : public CDialogEx
{
	DECLARE_DYNAMIC(CItemManage)

public:
	CItemManage(CWnd* pParent, CMeasureProject& project);   // standard constructor
	virtual ~CItemManage();

// Dialog Data
	enum { IDD = IDD_ITEM_MANAGE };

  static void AddItem(CItemManage* pWnd);
  static void DeleteItem(CItemManage* pWnd, const CMeasureItem *item);

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
  afx_msg void OnOk();
  afx_msg void OnCancel();
  afx_msg void OnItemAdd();
  afx_msg void OnItemDelete();
  afx_msg void OnItemChange();
  afx_msg void OnItemSave();
  afx_msg void OnSaveAll();
  virtual BOOL OnInitDialog();

public:
  LPCTSTR CurSelItemName;

private:
  CMeasureProject&  project_;
  CListBox wnd_item_list_;
  CEdit wnd_item_type_;
  CEdit wnd_item_first_;
  CEdit wnd_item_second_;
  CButton wnd_item_delete_;
  CStatic wnd_item_i_;
  CStatic wnd_item_ii_;
  CEdit wnd_coefficient_;
  CEdit wnd_offset_;
  CEdit wnd_name_;
  CButton wnd_edit_save_;
  double coefficient_;
  double offset_;
  CEdit wnd_target_;
  CEdit wnd_upper_;
  CEdit wnd_lower_;
  double target_;
  double upper_;
  double lower_;
  CString item_name_;
  CButton wnd_saveall_;
};
